<html>
<head>
	<meta charset="UTF-8">
	<title>axios-路由拦截</title>
	<script type="text/javascript" src="./axios.js"></script>
</head>
<body>

<script type="text/javascript">

// http request 拦截器
axios.interceptors.request.use((req) => {
    console.log(req);
    return req;
}, (error) => {
    console.log(error);
});
// http response 拦截器
axios.interceptors.response.use((res) => {
    console.log(res);
    return res;
}, (error) => {
    console.log(error);
});
//get 请求-1
axios({
    url: '/user/queryUserList.do',
    method: 'get',
    params: {
        id: '11',
        name: '22',
    }
})
//get 请求-2
axios.get('/user/queryUserList.do', {
    params: { 
        id: 'aa',
        name: 'bb'
    }
})


</script>
</body>
</html>